#
#  $Id$
#

@SET_MAKE@
srcdir = @srcdir@
VPATH = @srcdir@
RTEMS_ROOT = @top_srcdir@
PROJECT_ROOT = @PROJECT_ROOT@

LIB=$(ARCH)/libmisc.a

include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
include $(RTEMS_ROOT)/make/lib.cfg

#  Using the wildcard on the Purify support makes sure it may not be there

LIBS=../monitor/$(ARCH)/libmonitor-tmp.a \
     ../error/$(ARCH)/liberror-tmp.a \
     ../assoc/$(ARCH)/libassoc-tmp.a \
     ../stackchk/$(ARCH)/libstackchk-tmp.a \
     ../cpuuse/$(ARCH)/libcpuuse-tmp.a \
     ../rtmonuse/$(ARCH)/librtmonuse-tmp.a \
     $(wildcard ../purify/$(ARCH)/libpurify-tmp.a)
RELS=

CLEAN_ADDITIONS +=
CLOBBER_ADDITIONS +=

$(LIB): ${LIBS} $(RELS)
	$(RM) -r $(ARCH)
	$(MKDIR) $(ARCH)
	cd $(ARCH); for lib in $(LIBS:%=../%); do \
                         $(AR) -xv $$lib; \
                    done
	$(RM) $@
	$(AR) ruv $@ $(ARCH)/*
	$(MKLIB) $@

all:	${ARCH} $(SRCS) $(LIB)
	$(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib

